﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Resehantering.Account
{
    public partial class Register : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterUser.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"];
            RegisterUser.ContinueDestinationPageUrl = "register.aspx";
        }


        protected void RegisterUser_CreatedUser(object sender, EventArgs e)
        {
            

            profileClass p = (profileClass)profileClass.Create(RegisterUser.UserName);

            p.Fornamn = ((TextBox)RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("Fornamn")).Text;
            p.Efternamn = ((TextBox)RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("Efternamn")).Text;

            Roles.AddUserToRole(RegisterUser.UserName, "member");
        }

    }
}
